package vn.orderonline.core.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import vn.orderonline.core.dao.common.GenericDaoImpl;
import vn.orderonline.core.dao.entity.MenuFoodFood;
import vn.orderonline.core.dao.entity.MenuFoodFoodId;

@Repository
public class MenuFoodFoodDaoImpl extends GenericDaoImpl<MenuFoodFood, MenuFoodFoodId> implements MenuFoodFoodDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<MenuFoodFood> getListMenuFoodFoodByMenuFoodId(Integer menuFoodId) {
		Criteria criteria = getSession().createCriteria(MenuFoodFood.class);
		criteria.add(Restrictions.eq("id.menuFoodId", menuFoodId));
		return criteria.list();
	}

}
